package com.zsrt.java.day20161226.hzj.lasthomework;

import java.util.Scanner;

public class Star2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
		System.out.println("四边形行数");
		int s = sc.nextInt();
		if(s%2!=0){
			hw10(s);
			break;
		}
		else{
			System.out.println("输入一个奇数");
		}
		}
		sc.close();
	}
	public static void hw10(int a){
    	for(int hang=1;hang<=a/2+1;hang++){
			for(int kg=1;kg<=a/2+1-hang;kg++){
				System.out.print(" ");
			}
	
			for(int xx=1;xx<=2*hang-1;xx++){
				if(xx==1 || xx==(2*hang-1)){
					System.out.print("*");
				}else{
					
					System.out.print(" ");
				}
			     
			}
				System.out.println();
		}
    	int x = a/2+2;
		for(int hang=x;hang<=a;hang++){
			
			for(int kg=1;kg<=hang-x+1;kg++)
				System.out.print(" ");
			for(int xx=1;xx<=2*a+1-2*hang;xx++){
				
				if(xx==1 || xx==(2*a+1-2*hang))
					System.out.print("*");
				else{
					System.out.print(" ");
				}
				
			}
			System.out.println();
		}
	}
}
